package com.example.smart_city_0829.activity.volunteering;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.example.smart_city_0829.R;
import com.example.smart_city_0829.base.BaseActivity;
import com.example.smart_city_0829.entity.volunteering.VolunteeringList;
import com.google.gson.reflect.TypeToken;

public class VolunteeringDetailActivity extends BaseActivity {

    private VolunteeringList.RowsBean activity;

    private TextView name;
    private TextView detail;
    private TextView startTime;
    private TextView require;
    private TextView undertake;
    private TextView work;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_volunteering_detail;
    }

    @Override
    protected void initView() {
        name = (TextView) findViewById(R.id.name);
        detail = (TextView) findViewById(R.id.detail);
        startTime = (TextView) findViewById(R.id.start_time);
        require = (TextView) findViewById(R.id.require);
        undertake = (TextView) findViewById(R.id.undertake);
        work = (TextView) findViewById(R.id.work);
    }

    @Override
    protected void initData() {
        final String data = getIntent().getStringExtra("data");
        activity = gson.fromJson(data,new TypeToken<VolunteeringList.RowsBean>(){}.getType());

        name.setText(activity.getTitle());
        detail.setText(activity.getDetail());
        startTime.setText(activity.getStartAt());
        require.setText(activity.getRequireText());
        undertake.setText(activity.getUndertaker());

    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected String getActionBarTitle() {
        return "详细信息";
    }
}